﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GeFamily
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void CalcButton_Click(object sender, EventArgs e)
        {
            FamilyLevelCalculator.Calc(TTX.GetData());

            var stringBuilder=new StringBuilder();
            stringBuilder.AppendFormat("Exp: {0}\r\n", FamilyLevelCalculator.RoleLevel);
            stringBuilder.AppendFormat("Family Level: {0}\r\n", FamilyLevelCalculator.FamilyLevel);
            stringBuilder.AppendFormat("Next Level: {0}\r\n", FamilyLevelCalculator.FamilyLevelData[ FamilyLevelCalculator.FamilyLevel]);

            PPB.Maximum = FamilyLevelCalculator.FamilyLevelData[FamilyLevelCalculator.FamilyLevel] -
                          FamilyLevelCalculator.FamilyLevelData[FamilyLevelCalculator.FamilyLevel - 1];

            PPB.Value = FamilyLevelCalculator.RoleLevel -
                        FamilyLevelCalculator.FamilyLevelData[FamilyLevelCalculator.FamilyLevel - 1];

            TTT.Text = stringBuilder.ToString();
        }

        private void LoadButton_Click(object sender, EventArgs e)
        {
            TTX.LoadData();
        }

        private void SaveButton_Click(object sender, EventArgs e)
        {
            TTX.SaveData();
        }
    }
}
